package classroom;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:周次煜
 * Date: 2024-03-29
 * Time：10:39
 */







//class Cat {
//    public String name;
//    public  int age;
//    public  String color;
//
//    public Cat(String name, int age, String color) {
//        this.name = name;
//        this.age = age;
//        this.color = color;
//    }
//
//    @Override
//    public String toString() {
//        return "Cat{" +
//                "name='" + name + '\'' +
//                ", age=" + age +
//                ", color='" + color + '\'' +
//                '}';
//    }
//}
//
//public class Testdemo3 {
//
//    public static void main(String[] args) {
//        Cat1 cat1=new Cat1("小花",13,"花色");
//        System.out.println(cat1);
//        Cat1 cat2=new Cat1("小白",15,"白色");
//        System.out.println(cat2);
//    }
//
//}




class Person {



    public static String name;

    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "age=" + age + "name=" + name+
        '}';
    }


    public static void main(String[] args) {
        Person p=new Person();
        Person.name="小张";
        p.setAge(23);
        System.out.println(Person.name);
        System.out.println(p.getAge());
    }
}

class  Car {



    public String brand;

    public String type;
    public double price;

public double speed;

    public Car(String brand, String type, double price, double speed) {
        this.brand = brand;
        this.type = type;
        this.price = price;
        this.speed = speed;
    }

    public void displaySpeed() {
    System.out.println(this.brand+" 正在以时速每小时 "+this.speed+" 千米飞奔而来! ");
}

    public static void main(String[] args) {
        Car c1=new Car("小米suv17","跑车",200000,300);
        c1.displaySpeed();
    }
}